package stark.app.frame.netframe;

import android.widget.ImageView;

import androidx.databinding.BindingAdapter;

import com.bumptech.glide.Glide;

import stark.app.BR;
import stark.app.R;
import stark.app.databinding.ItemDetailBinding;
import stark.common.basic.adapter.BaseDBRVAdapter;


/**
 * <pre>
 *     author : cfans
 *     time   : 2020/10/09
 *     desc   :
 *     version: 1.0
 * </pre>
 */
public class DetailAdapter extends BaseDBRVAdapter<DetailBean.CartoonBean, ItemDetailBinding> {

    public DetailAdapter() {
        super(R.layout.item_detail, BR.bean);
    }

    /**
     * 绑定Adapter的ImageView
     *
     * @param imageView
     * @param url       图片地址
     */
    @BindingAdapter({"imageUrl"})
    public static void loadImage(ImageView imageView, String url) {
        Glide.with(imageView.getContext()).load(url).into(imageView);
    }

//    @BindingAdapter({"textName"})
//    public static void setName(TextView textView, String name) {
//        textView.setText(name);
//    }
}